import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HthxflVO, HthxflForm, HthxflQuery } from '@/api/biz/hthxfl/types';

/**
 * 查询海棠红幸福里列表
 * @param query
 * @returns {*}
 */

export const listHthxfl = (query?: HthxflQuery): AxiosPromise<HthxflVO[]> => {
  return request({
    url: '/biz/hthxfl/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询海棠红幸福里详细
 * @param id
 */
export const getHthxfl = (id: string | number): AxiosPromise<HthxflVO> => {
  return request({
    url: '/biz/hthxfl/' + id,
    method: 'get'
  });
};

/**
 * 新增海棠红幸福里
 * @param data
 */
export const addHthxfl = (data: HthxflForm) => {
  return request({
    url: '/biz/hthxfl',
    method: 'post',
    data: data
  });
};

/**
 * 修改海棠红幸福里
 * @param data
 */
export const updateHthxfl = (data: HthxflForm) => {
  return request({
    url: '/biz/hthxfl',
    method: 'put',
    data: data
  });
};

/**
 * 删除海棠红幸福里
 * @param id
 */
export const delHthxfl = (id: string | number | Array<string | number>) => {
  return request({
    url: '/biz/hthxfl/' + id,
    method: 'delete'
  });
};
